package com.jason.rxjavatest.test;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;

import com.jason.rxjavatest.R;

/**
 * @Author: Jason
 * @Date: 16/1/12
 * @Time: 16:00
 */

public class HomeBackAcitivyt extends Activity {

    private static final String TAG = HomeBackAcitivyt.class.getSimpleName();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_homeback);


        findViewById(R.id.bt).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(HomeBackAcitivyt.this, HomeBActivity.class);
                startActivity(intent);

            }
        });

        Log.e(TAG, "onCreate");

    }


    @Override
    protected void onStart() {
        super.onStart();

        Log.e(TAG, "onStart");

    }

    @Override
    protected void onResume() {
        super.onResume();
        Log.e(TAG, "onResume");

    }

    @Override
    protected void onPause() {
        super.onPause();
        Log.e(TAG, "onPause");

    }

    @Override
    protected void onStop() {
        super.onStop();
        Log.e(TAG, "onStop");

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();

        Log.e(TAG, "onDestroy");


    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {

        if (keyCode == KeyEvent.KEYCODE_BACK) {
            moveTaskToBack(true);
        }

        return super.onKeyDown(keyCode, event);


    }

    @Override
    public void onBackPressed() {
        super.onBackPressed();

        moveTaskToBack(true);

    }
}
